﻿using System;

namespace MsTestUtilities.RowTests
{
    public static class DoubleExpector
	{	
    	public static Justifier<T1, double> Expect<T1>(this Expector<T1, double> expector, double expected, double precision)
		{
			Predicate<double> predicate = a => Math.Abs(expected - a) < precision;
			var expectation = new Expectation<double>(predicate);
			return expector.Expect(expectation);
		}	
			    
    	public static Justifier<T1, T2, double> Expect<T1, T2>(this Expector<T1, T2, double> expector, double expected, double precision)
		{
			Predicate<double> predicate = a => Math.Abs(expected - a) < precision;
			var expectation = new Expectation<double>(predicate);
			return expector.Expect(expectation);
		}	
			    
    	public static Justifier<T1, T2, T3, double> Expect<T1, T2, T3>(this Expector<T1, T2, T3, double> expector, double expected, double precision)
		{
			Predicate<double> predicate = a => Math.Abs(expected - a) < precision;
			var expectation = new Expectation<double>(predicate);
			return expector.Expect(expectation);
		}	
			    
    	public static Justifier<T1, T2, T3, T4, double> Expect<T1, T2, T3, T4>(this Expector<T1, T2, T3, T4, double> expector, double expected, double precision)
		{
			Predicate<double> predicate = a => Math.Abs(expected - a) < precision;
			var expectation = new Expectation<double>(predicate);
			return expector.Expect(expectation);
		}	
			    
    	public static Justifier<T1, T2, T3, T4, T5, double> Expect<T1, T2, T3, T4, T5>(this Expector<T1, T2, T3, T4, T5, double> expector, double expected, double precision)
		{
			Predicate<double> predicate = a => Math.Abs(expected - a) < precision;
			var expectation = new Expectation<double>(predicate);
			return expector.Expect(expectation);
		}	
			    
    	public static Justifier<T1, T2, T3, T4, T5, T6, double> Expect<T1, T2, T3, T4, T5, T6>(this Expector<T1, T2, T3, T4, T5, T6, double> expector, double expected, double precision)
		{
			Predicate<double> predicate = a => Math.Abs(expected - a) < precision;
			var expectation = new Expectation<double>(predicate);
			return expector.Expect(expectation);
		}	
			    
	}
}
